package com.medical.client.controller.personal;


import com.medical.client.controller.RootController;
import com.medical.client.model.Context;
import javafx.fxml.FXML;
import javafx.scene.control.*;
import javafx.stage.Stage;

/**
 * @ClassName: PersonalGridController
 * @Description: TODO
 * @Author: JackyLee
 * @Date: 2024/6/3 22:23
 **/
public class GridController extends RootController {

    @FXML
    Button queryBtu;

    @FXML
    Button uploadBtu;

    @FXML
    private TextField demc;

    @FXML
    private TextField tjh;

    @FXML
    private TextField jcls;

    @FXML
    CheckBox isCheck;

    @FXML
    private DatePicker datePickerStart;

    @FXML
    private DatePicker datePickerEnd;

    @FXML
    private void initialize() {
        datePickerStart.setOnAction(event -> {

        });
        datePickerEnd.setOnAction(event -> {

        });
    }


    @FXML
    public void queryBtu() {
        BorderController functionController = (BorderController) Context.controllers.get("com.medical.client.controller.personal.BorderController");
        functionController.setData(demc.getText(), tjh.getText(), jcls.getText(),null,null,isCheck.isSelected());
    }
    @FXML
    public void clearBtu() {
        System.out.println("clear");
        BorderController functionController = (BorderController) Context.controllers.get("com.medical.client.controller.personal.BorderController");
        functionController.clearData();

        demc.clear();
        tjh.clear();
        jcls.clear();

    }

    @FXML
    public void uploadBtu(){
        BorderController functionController = (BorderController) Context.controllers.get("com.medical.client.controller.personal.BorderController");
        functionController.uploadData();
    }

    public void setBtu(Boolean isUse){
        queryBtu.setDisable(isUse);
        uploadBtu.setDisable(isUse);
    }
}

